<template>
<UserForm isRegister @onSubmit="onSubmit"/>
</template>

<script>
import { registerAPI } from '@/api/user'
import UserForm from '@/components/UserForm.vue'

export default {
  components: {
    UserForm
  },
  name: 'Register-Page',
  methods: {
    async onSubmit (values) {
      await registerAPI(values)
      this.$toast('注册成功')
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>

</style>
